package no.ntnu.fp.messages;

import java.awt.LayoutManager;
import java.util.Map;

import no.ntnu.fp.model.AbstractModel;
import no.ntnu.fp.model.Appointment;

public class Message extends AbstractModel {

	
	public enum MessageType {
		INVITE, DEINVITE, MEETING_CHANGED, MEETING_CANCELED
	}

	private MessageType messageType;
	private Appointment appointment;
	boolean active = true;
	
	
	/**
	 * Getter of the property <tt>messageType</tt>
	 * @return  Returns the messageType.
	 */
	public MessageType getMessageType() {
		return messageType;
	}

	/**
	 * Setter of the property <tt>messageType</tt>
	 * @param messageType  The messageType to set.
	 */
	public void setMessageType(MessageType messageType) {
		this.messageType = messageType;
	}


	/**
	 * Getter of the property <tt>appointment</tt>
	 * @return  Returns the appointment.
	 */
	public Appointment getAppointment() {
		return appointment;
	}

	/**
	 * Setter of the property <tt>appointment</tt>
	 * @param appointment  The appointment to set.
	 */
	public void setAppointment(Appointment appointment) {
		this.appointment = appointment;
	}

	@Override
	public Map<String, Object> pack() {

		return null;
	}

//	@Override
//	protected void update(int id, String attribute, Object value) {
//	}

	@Override
	protected void writeAttribute(String attribute, Object value) {
	}

//	@Override
//	protected void updateAttribute(int id, String attribute, Object value) {
//	}

	@Override
	public void unpack(Map<String, Object> map) {
	}

	public void messageViewed(){
		active=false;
	}
	
	public void setMessageActiveState(boolean activeState){
		active = activeState;
	}
	
	public static Message example() {
		Message message = new Message();
		message.appointment = Appointment.example();
		message.messageType = MessageType.INVITE;
		return message;
	}

}
